/**
 * 
 */
package com.ekingstar.framework.service;

import java.util.List;
import java.util.Map;

import org.springframework.security.userdetails.UserDetailsService;

import com.ekingstar.framework.dataright.IDataRightConverter;
import com.ekingstar.framework.dataright.RowDataRightLevel;
import com.ekingstar.framework.domain.Function;
import com.ekingstar.framework.domain.Person;
import com.ekingstar.framework.domain.User;
import com.ekingstar.framework.util.Page;

/**
 * 
 *
 */
public interface IUserService extends UserDetailsService{

	public boolean addUser(User user);
	public boolean saveUser(User user);
	public boolean updateUser(User user);
	public boolean deleteUser(String id);
	public User viewUser(String id);
	public List<User> getUserlist();
	public  Person getUserInfo(String name);
	public Page getUserlist(User user,int pageNo,int pageSize);
	public boolean checkPassword(User user);
	public void changePWD(User user, String npwd);
	//获取最近10使用的功能
	public List<Function> getLastFunctions(String uId);
	//
	public boolean updateLastFunction(String uId,Function fun);
	public List<Function> getMyFavarites(String userId);
	public boolean addOrUpdateMyFavarites(String uId,List funs);
	//
	//获取该用户的数据权限:仅适合高教用户,数据权限包括，（校级，院级，专业，班级)级别,//返回sql
	public Object getUserRowDataRights(String uId,RowDataRightLevel level,IDataRightConverter converter);
	//
	//获取我授权的用户
	public List<User> getGrantUsers(String uId,String roleId);
	//下发权限
	public boolean grantMyRightToUsers(String uId,String roleId,Boolean canUse,Boolean canGrant,List<User> users);
	//收回我下发的权限
	public boolean invokeMyRightFromUser(String myId,String roleId,Boolean canUse,Boolean canGrant,String uId);
	//
	public int getPwdErrorCount(String uId,boolean isUpdate);
	public void clearErrorCount(String uId);
	public boolean changUserInfo(User user);
	//获取用户的访问当前功能的参数值
	public Map getUserFunctionParamValues(String userId,String funAddress);
}
